// NAVBAR (FIXED AND STATIC)
// -------------------------

.navbar {
  // Fix for IE7's bad z-indexing so dropdowns don't appear below content that follows the navbar
  *position: relative;
  *z-index: 2;

  overflow: visible;
  margin-bottom: @baseLineHeight;
}

// Gradient is applied to it's own element because overflow visible is not honored by IE when filter is present
.navbar-inner {
  min-height: @navbarHeight;
  padding-left:  20px;
  padding-right: 20px;
  #gradient > .vertical(@navbarBackgroundHighlight, @navbarBackground);
  .border-radius(4px);
  .box-shadow(~"0 1px 3px rgba(0,0,0,.25), inset 0 -1px 0 rgba(0,0,0,.1)");
}

// Set width to auto for default container
// We then reset it for fixed navbars in the #gridSystem mixin
.navbar .container {
  width: auto;
}

// Override the default collapsed state
.nav-collapse.collapse {
  height: auto;
}


// Brand, links, text, and buttons
.navbar {
  color: @navbarText;
  // Hover and active states
  .brand:hover {
    text-decoration: none;
  }
  
  
  
  // Buttons in navbar
  .btn,
  .btn-group {
    .navbarVerticalAlign(30px); // Vertically center in navbar
  }
  .btn-group .btn {
    margin: 0; // then undo the margin here so we don't accidentally double it
  }
}


// Navbar search
.navbar-search {
  position: relative;
  float: left;
  .navbarVerticalAlign(28px); // Vertically center in navbar
  margin-bottom: 0;
  .search-query {
    padding: 4px 9px;
    #font > .sans-serif(13px, normal, 1);
    color: @white;
    background-color: @navbarSearchBackground;
    border: 1px solid @navbarSearchBorder;
    .box-shadow(~"inset 0 1px 2px rgba(0,0,0,.1), 0 1px 0 rgba(255,255,255,.15)");
    .transition(none);

    .placeholder(@navbarSearchPlaceholderColor);

    // Focus states (we use .focused since IE7-8 and down doesn't support :focus)
    &:focus,
    &.focused {
      padding: 5px 10px;
      color: @grayDark;
      text-shadow: 0 1px 0 @white;
      background-color: @navbarSearchBackgroundFocus;
      border: 0;
      .box-shadow(0 0 3px rgba(0,0,0,.15));
      outline: 0;
    }
  }
}



// FIXED NAVBAR
// ------------

// Shared (top/bottom) styles
.navbar-fixed-top,
.navbar-fixed-bottom {
  position: fixed;
  right: 0;
  left: 0;
  z-index: @zindexFixedNavbar;
  margin-bottom: 0; // remove 18px margin for static navbar
}
.navbar-fixed-top .navbar-inner,
.navbar-fixed-bottom .navbar-inner {
  padding-left:  0;
  padding-right: 0;
  .border-radius(0);
}

.navbar-fixed-top .container,
.navbar-fixed-bottom .container {
  #grid > .core > .span(@gridColumns);
}

// Fixed to top
.navbar-fixed-top {
  top: 0;
}

// Fixed to bottom
.navbar-fixed-bottom {
  bottom: 0;
}



// NAVIGATION
// ----------

.navbar .nav {
  position: relative;
  left: 0;
  display: block;
  float: left;
  margin: 0 10px 0 0;
}
.navbar .nav.pull-right {
  float: right; // redeclare due to specificity
}
.navbar .nav > li {
  display: block;
  float: left;
}

// Links
.navbar .nav > li > a {
  float: none;
  // Vertically center the text given @navbarHeight
  @elementHeight: 20px;
  padding: ((@navbarHeight - @elementHeight) / 2 - 1) 10px ((@navbarHeight - @elementHeight) / 2 + 1);
  line-height: 19px;
  color: @navbarLinkColor;
  text-decoration: none;
  text-shadow: 0 -1px 0 rgba(0,0,0,.25);
}
// Buttons
.navbar .btn {
  display: inline-block;
  padding: 4px 10px 4px;
  // Vertically center the button given @navbarHeight
  @elementHeight: 28px;
  margin: ((@navbarHeight - @elementHeight) / 2 - 1) 5px ((@navbarHeight - @elementHeight) / 2);
  line-height: @baseLineHeight;
}
.navbar .btn-group {
  margin: 0;
  // Vertically center the button given @navbarHeight
  @elementHeight: 28px;
  padding: ((@navbarHeight - @elementHeight) / 2 - 1) 5px ((@navbarHeight - @elementHeight) / 2);
}
// Hover
.navbar .nav > li > a:hover {
  background-color: @navbarLinkBackgroundHover; // "transparent" is default to differentiate :hover from .active
  color: @navbarLinkColorHover;
  text-decoration: none;
}

// Active nav items
.navbar .nav .active > a,
.navbar .nav .active > a:hover {
  color: @navbarLinkColorActive;
  text-decoration: none;
  background-color: @navbarLinkBackgroundActive;
}

// Dividers (basically a vertical hr)
.navbar .divider-vertical {
  height: @navbarHeight;
  width: 1px;
  margin: 0 9px;
  overflow: hidden;
  background-color: @navbarBackground;
  border-right: 1px solid @navbarBackgroundHighlight;
}

// Secondary (floated right) nav in topbar
.navbar .nav.pull-right {
  margin-left: 10px;
  margin-right: 0;
}

// Navbar button for toggling navbar items in responsive layouts
// These definitions need to come after '.navbar .btn'
.navbar .btn-navbar {
  display: none;
  float: right;
  padding: 7px 10px;
  margin-left: 5px;
  margin-right: 5px;
  .buttonBackground(@navbarBackgroundHighlight, @navbarBackground);
  .box-shadow(~"inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.075)");
}




